package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GxTemplateCategoryMapper;
import com.ruoyi.system.domain.GxTemplateCategory;
import com.ruoyi.system.service.IGxTemplateCategoryService;

/**
 * 模板分类Service业务层处理
 * 
 * @author hy
 * @date 2022-11-22
 */
@Service
public class GxTemplateCategoryServiceImpl implements IGxTemplateCategoryService 
{
    @Autowired
    private GxTemplateCategoryMapper gxTemplateCategoryMapper;

    /**
     * 查询模板分类
     * 
     * @param id 模板分类主键
     * @return 模板分类
     */
    @Override
    public GxTemplateCategory selectGxTemplateCategoryById(Long id)
    {
        return gxTemplateCategoryMapper.selectGxTemplateCategoryById(id);
    }

    /**
     * 查询模板分类列表
     * 
     * @param gxTemplateCategory 模板分类
     * @return 模板分类
     */
    @Override
    public List<GxTemplateCategory> selectGxTemplateCategoryList(GxTemplateCategory gxTemplateCategory)
    {
        return gxTemplateCategoryMapper.selectGxTemplateCategoryList(gxTemplateCategory);
    }

    /**
     * 新增模板分类
     * 
     * @param gxTemplateCategory 模板分类
     * @return 结果
     */
    @Override
    public int insertGxTemplateCategory(GxTemplateCategory gxTemplateCategory)
    {
        gxTemplateCategory.setCreateTime(DateUtils.getNowDate());
        return gxTemplateCategoryMapper.insertGxTemplateCategory(gxTemplateCategory);
    }

    /**
     * 修改模板分类
     * 
     * @param gxTemplateCategory 模板分类
     * @return 结果
     */
    @Override
    public int updateGxTemplateCategory(GxTemplateCategory gxTemplateCategory)
    {
        gxTemplateCategory.setUpdateTime(DateUtils.getNowDate());
        return gxTemplateCategoryMapper.updateGxTemplateCategory(gxTemplateCategory);
    }

    /**
     * 批量删除模板分类
     * 
     * @param ids 需要删除的模板分类主键
     * @return 结果
     */
    @Override
    public int deleteGxTemplateCategoryByIds(Long[] ids)
    {
        return gxTemplateCategoryMapper.deleteGxTemplateCategoryByIds(ids);
    }

    /**
     * 删除模板分类信息
     * 
     * @param id 模板分类主键
     * @return 结果
     */
    @Override
    public int deleteGxTemplateCategoryById(Long id)
    {
        return gxTemplateCategoryMapper.deleteGxTemplateCategoryById(id);
    }
}
